package com.itheima.service.impl;

import com.itheima.dao.BookDao;
import com.itheima.po.Book;
import com.itheima.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Andy
 * @Description //TODO BookServiceImpl
 * @Date 2022/2/28 4:31 下午
 * @Version 1.0
 **/
@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookDao bookDao;


    public int insert(Book book) {
        return bookDao.insert(book);
    }

    public int update(Book book) {
        return bookDao.update(book);
    }

    public int updateStatusById(String status, int id) {
        return bookDao.updateStatusById(status, id);
    }

    public Book getById(int id) {
        return bookDao.getById(id);
    }

    public int delete(int id) {
        return bookDao.delete(id);
    }

    public List<Book> getAll() {
        return bookDao.getAll();
    }

}
